<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    
    <script>
        var arr2= [1, 2, 3];
        Array.prototype.unshift1 = function () {
            var arr1 = [];
            for (var i = 0; i < arguments.length; i++) {
                arr1[arr1.length] = arguments[i];
            }
            for (var j = 0; j < arr2.ength; j++) {
                arr1[arr1.length] = arr2[j];
            }
            for (var k = 0; k < arr1.length; k++) {
                this[k]=arr1[k]
            }
            return arr1.length;
        }
        //arr.unshift1(1, 2, 3)
        // console.log(arr);
        console.log(arr2.unshift1(1, 2, 3));
        console.log(arr2);



    </script>
</body>

</html>